package com.my.jvm.task;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Zijian Liao
 * @since 1.0.0
 */
@RequestMapping
@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/refund")
    public synchronized String refundOrder(String orderNo) throws InterruptedException {
        return orderService.refundOrder(orderNo);
    }
}
